set :application, "surveys"
set :repository,  "svn://204.152.218.194:9999/repos/surveys"
 
set :deploy_to, "/home/rails/apps/#{application}"
set :checkout, "export"
set :use_sudo, false
 
role :app, "204.152.218.194"
role :web, "204.152.218.194"
 
set :user, "root"
set :password, "tGqr2RN6qWlI"
 
namespace :deploy do
  task :start, :roles => :app do
    run "touch #{current_release}/tmp/restart.txt"
  end
 
  task :stop, :roles => :app do
    # Do nothing.
  end
 
  desc "Restart Application"
  task :restart, :roles => :app do
    run "touch #{current_release}/tmp/restart.txt"
  end

  task :create_file_link, :roles => :app do   
    run "ln -s #{deploy_to}/shared/files/ #{deploy_to}/current/public/files"   
  end  
      
  task :chmod, :roles => :app do  
    run "chmod -fR 755 #{deploy_to}/current/script/*"  
    run "chmod -R 777 #{deploy_to}/current/public"  
  end  

  after "deploy:symlink", "deploy:chmod"
end
